//
//  ShopCollectionViewCell.m
//  A段项目
//
//  Created by 官琛 on 15-6-19.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "ShopCollectionViewCell.h"

@implementation ShopCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatTable];
    }
    return self;
    
}

-(void)creatTable
{
    self.imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(0, -5, self.contentView.frame.size.width, self.contentView.frame.size.height-80)];
    self.imageView1.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.imageView1];
    [_imageView1 release];
    
    
    self.label = [[UILabel alloc]initWithFrame:CGRectMake(5, self.contentView.frame.size.height-60, self.contentView.frame.size.width, 60)];
    self.label.numberOfLines = 0;
    self.label.text = @"111111111";
    [self.contentView addSubview:self.label];
    [_label release];
    
    self.label1 = [[UILabel alloc]initWithFrame:CGRectMake(5, self.contentView.frame.size.height - 70, self.contentView.frame.size.width, 20)];
    self.label1.textColor = [UIColor orangeColor];
    [self.contentView addSubview:self.label1];
    [_label1 release];
    
}

-(void)setGood:(goods *)good
{
    if (_good != good) {
        [_good release];
        _good = [good retain];
    }
    self.label.text = good.name;
    NSInteger a = good.minSalePrice*0.01;
    self.label1.text = [NSString stringWithFormat:@"价格为 :%ld",a];
    NSURL *url = [NSURL URLWithString:good.image];
    [self.imageView1 sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"12346.jpg"]];
}

@end
